
class Game{
    constructor(){
        this.sky=new Sky();
        this.land=new Land(-100);
        this.bird=new Bird();
        this.pipeProducer=new this.pipeProducer(-100);
        this.timer=null;
        this.tick=16;
    }
    start(){
        if(this.timer){return;}
        this.pipeProducer.startProducer();
        this.timer=setInterval(() => {
            const duration=this.tick/1000;
            this.sky.move(duration);
            this.land.move(duration);
            this.bird.move(duration);
            this.pipeProducer.pares.forEach(pare=>{
                pare.move(duration);
            })
        }, this.tick);
    }
    stop(){

    }
}
var g=new Game();